The Add-ons are reusable code useful in SAT projects. However, the reusability is more questionable than for the routines in the SAT library, so I keep them outside both to make it easy to adapt them to your problems, and to keep the SAT library smaller.
Most add-ons are at this time written and tested mostly under Think Pascal. (Since that's where the best debugger is, that's where everything gets debugged. Demand something comparable no matter what language you use!) I make the necessary additions/conditional compile for CodeWarrior as I get time. Most units are in a library for Think C users. Units with "stubs" files are not included there.
If you are a C user, and have a Pascal compiler as well - e.g. if you have CodeWarrior - you can make whatever changes needed and build a library with your own "stubs" files. With CodeWarrior 7 and up, you don't even have to build a library any more. You can just include the Pascal files in your C projects. There are header files for all or almost all add-ons. WARNING! Although all Pascal code is reasonably tested, the header files are hardly tested at all by me! If you get strange results, check that parametes are passed correctly, and please report any such bugs to me.
WARNING! Note that some units are highly preliminary at this time! There are bugs left, many features are poorly documented, and there are limitations that may be removed later. Routine names may get changed, e.g. get a prefix of some kind.
The add-ons are divided into four groups: Load faces, Sprite behavior, Storage and Graphic effects.
Load faces
=========
FaceFromPict: This is an old file that has been part of SAT for a very long time. It creates a face from a set of PICT resources. It comes in both Pascal and C versions.
FaceFromText: This routine will create a face from a string, in the appropriate size, style and color. It comes in both Pascal and C versions.
FastLoad: This unit holds routines for loading many faces from one single PICT. This is very useful for speeding up the loading process when using large amounts of faces. Note: the faces in your picts must have a spacing that is divisible by 8, and prefers a spacing divisible by 16 or even 32.
FaceFromICN: This unit loads a face from an "#ICN" resource. Yes, that means 32x32 pixels and B/W only.
Sprite behavior
==============
SATToolbox: This is a large unit with very useful routines that I've long wanted in the library itself, but it will be in this add-on to begin with. The routines handle sprite movement, border checks, collisions, plus look-up table based trig functions and square root.
SATGridToolbox: This unit handles sprite movement in a grid (somewhat like Oxyd). SATToolbox and SATGridStubs are required.
SATGridStubs: When using SATGridToolbox, you should make a COPY of SATGridStubs and put in your project folder. This file should be edited to define the grid you want to use, its size and how to draw it. This file exists to separate the reusable code (in SATGridToolbox) from the custom code, variables and constants.
SATStrictGridToolbox: This unit handles sprite movement in a *strict* grid. A struct grid means that the sprites can only move from grid position to grid position. It is useful for making games like PacMan.
SortingUtils: The routine BucketSort is the interesting part. It sorts the entire sprite list completely in very short time.
Storage:
=======
Preferences: This is almost the same file that used to be in the HeartQuest project. It is slightly improved, has no longer any globals. It opens and creates preference files (in the Preferences folder).
Scores: This unit handles score and high score display. The "stubs" file ScoresStubs is needed, and is where you should make changes to handle things the way you need. The high score list can be drawn in any window you like.
Settings: This unit simplifies settings. You should use Preferences for putting the settings in a preferences file. Settings initializes and saves them, and includes a routine for asking for key configuration.
NOTE: You really don't have to create neither pref file or settings structures until the user changes a setting or gets a high score. However, it is quite a bit more trouble, so I usually create them right away.
Graphic effects
==============
GammaFade: Routines for fading the screen with the gamma table. This works on most color/bw Macs. This gamma fading unit will allow the user to abort the fading effect with a mouse click. (Long fades will often get tedious otherwise.)
ProgressBar: An adaptive progress bar, VERY easy to use. You don't have to worry about how far it should draw; just call it often enough and it will work and look pretty ok.
Pixels: Routines for drawing and copying sets of single pixels. This is much faster than using lots of small sprites for making things like starfields or pixel-baed explosions. See SAT Invaders for a demo.
AlphaSAT: Routines for manipulating the alpha channel. This is of interest when making animations to mix with live video. This is only meaningful in 32-bit color and with hardware that supports the alpha channel.
MySlotVBL: A unit for synchronizing the graphics with the screen update. The unit is not SAT-dependant, but can be used in any program. It uses SlotVBL if available (i.e. all modern Macs) but falls back on old-style VBL if it isn't.
SATSetDepth: A unit for setting the screen depth. Updating faces that have already been loaded, if any, (for cicn-based faces, by calling SATDepthChangeTest) is your responsability. C users can also use the file depth-switcher.c, by Richard Bannister.
MiscGraphics: This unit holds a bunch of useful graphics-related routines. It has better glue code for patterns than the old ones in SAT.lib, and similar routines for cursors. There are transitions to use for scenery switches, and some simple utilities just for simplifying your code a bit.